﻿<%
Function ctoh(Str) 'SQL的过滤
If Isnull(Str) Then
ctoh=""
Exit Function
End If
Str=Replace(Str,Chr(0),"",1,-1,1)
Str=Replace(Str,Chr(34)&Chr(34),Chr(34),1,-1,1)
Str=Replace(Str,"<；","<；",1,-1,1)
Str=Replace(Str,">；",">；",1,-1,1)
Str=Replace(Str,"script","script",1,-1,0)
Str=Replace(Str,"SCRIPT","SCRIPT",1,-1,0)
Str=Replace(Str,"Script","Script",1,-1,0)
Str=Replace(Str,"script","Script",1,-1,1)
Str=Replace(Str,"object","object",1,-1,0)
Str=Replace(Str,"OBJECT","OBJECT",1,-1,0)
Str=Replace(Str,"Object","Object",1,-1,0)
Str=Replace(Str,"object","Object",1,-1,1)
Str=Replace(Str,"applet","applet",1,-1,0)
Str=Replace(Str,"APPLET","APPLET",1,-1,0)
Str=Replace(Str,"Applet","Applet",1,-1,0)
Str=Replace(Str,"applet","Applet",1,-1,1)
Str=Replace(Str,"[","[")
Str=Replace(Str,"]","]")
Str=Replace(Str,Chr(34)&Chr(34),"",1,-1,1)
Str=Replace(Str,"=","=",1,-1,1)
Str=Replace(Str,"'","''",1,-1,1)
Str=Replace(Str,"select","select",1,-1,1)
Str=Replace(Str,"execute","execute",1,-1,1)
Str=Replace(Str,"exec","exec",1,-1,1)
Str=Replace(Str,"join","join",1,-1,1)
Str=Replace(Str,"union","union",1,-1,1)
Str=Replace(Str,"where","where",1,-1,1)
Str=Replace(Str,"insert","insert",1,-1,1)
Str=Replace(Str,"delete","delete",1,-1,1)
Str=Replace(Str,"update","update",1,-1,1)
Str=Replace(Str,"like","like",1,-1,1)
Str=Replace(Str,"drop","drop",1,-1,1)
Str=Replace(Str,"create","create",1,-1,1)
Str=Replace(Str,"rename","rename",1,-1,1)
Str=Replace(Str,"count","count",1,-1,1)
Str=Replace(Str,"chr","chr",1,-1,1)
Str=Replace(Str,"mid","mid",1,-1,1)
Str=Replace(Str,"truncate","truncate",1,-1,1)
Str=Replace(Str,"nchar","nchar",1,-1,1)
Str=Replace(Str,"char","char",1,-1,1)
Str=Replace(Str,"alter","alter",1,-1,1)
Str=Replace(Str,"cast","cast",1,-1,1)
Str=Replace(Str,"exists","exists",1,-1,1)
Str=Replace(Str,Chr(13),"<；br>；",1,-1,1)
Str=Replace(Str,"'","''",1,-1,1)
Str=Replace(Str," ","")
ctoh=Str
End Function

sub close_rs(object)
 object.close
 Set object=Nothing
end sub
%>

<% Function formatDate(dateStr,para) '格式化日期 %>
<%
If para="shortDate" Then '0000-00-00 00:00
 formatDate=Year(dateStr)&"-"&Right("0"&Month(dateStr),2)&"-"&Right("0"&Day(dateStr),2)&" "&Right("0"&Hour(dateStr),2)&":"&Right("0"&Minute(dateStr),2)
ElseIf para="longDate" Then '0000-00-00 00:00:00
 formatDate=Year(dateStr)&"-"&Right("0"&Month(dateStr),2)&"-"&Right("0"&Day(dateStr),2)&" "&Right("0"&Hour(dateStr),2)&":"&Right("0"&Minute(dateStr),2)&":"&Right("0"&Second(dateStr),2)
Else '0000-00-00
 formatDate=Year(dateStr)&"-"&Right("0"&Month(dateStr),2)&"-"&Right("0"&Day(dateStr),2)
End If 
%>
<% End Function %>

<% Function gameCoinName(gameCoinId) '游戏币的名称 %>
<%
Set tmp=Server.CreateObject("ADODB.RecordSet")
tmp.open "select * from gameCoin where gameCoinId="&CInt(gameCoinId),conn,0,1
If Not tmp.eof Then 
    gameCoinName=tmp("gameCoinName")
    gameCoinUnit=tmp("gameCoinUnit")
    gameCoinDisplayBuLuo=tmp("gameCoinDisplayBuLuo")
    descript =tmp("descript")
    photo_filename=tmp("photo_filename")
End If 
Call close_rs(tmp)
%>
<% End Function %>

<% Sub gameCoinDistrict(gameCoinId) '游戏区类别%>
<select name="gameCoinDistrict" id="gameCoinDistrict" onchange="changeSelect(this.value);itemReset();">
 <option>--游戏区--</option>
<%
Dim tmp
Set tmp=Server.CreateObject("ADODB.RecordSet")
tmp.open "select gameCoinDistrictId,gameCoinDistrictName from gameCoinDistrict where gameCoinId="&CInt(gameCoinId)&" and isShow=1 order by orders_value ",conn,1,1
Do While Not tmp.eof 
%>
 <option value="<%=tmp("gameCoinDistrictId")%>"><%=tmp("gameCoinDistrictName")%></option>
<%
 tmp.movenext
 If tmp.eof Then Exit Do 
Loop 
Call close_rs(tmp)
%>
</select>
<% End Sub %>



<% Sub showGameDiv(gameCoinId,gameCoinDisplayBuLuo) '显示或是隐藏游戏币部落/联盟 %>
<%
 If gameCoinDisplayBuLuo=1 Then 'show
 %>
    <tr>
     <td align="right" valign="middle">请选择部落/联盟：</td>
     <td>
      <select name="gameCoinDiv" id="gameCoinDiv" onchange='chkGameCoin("<%=gameCoinId%>","<%=gameCoinDisplayBuLuo%>")'>
       <option value="1">部落</option>
       <option value="2">联盟</option>
      </select>
     </td>
    </tr>
 <%
 End If 
 %>
<% End Sub %>

